{block name="style"}
{/block}
{block name="content"}
<div class="info-header">
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">分组名称</label>
            <div class="layui-input-block">
                <input type="text" value="{$group.group_name}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">权重</label>
            <div class="layui-input-block">
                <input type="text" value="{$group.sort}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" value="{$group.remark}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <span style="line-height: 36px;" class="{$group.status?'text-yellow':'text-muted'}"><i class="fa fa-circle"></i>{$group.status?'可用':'禁用'}</span>
            </div>
        </div>
    </div>
</div>
<div class="info-body">
    <div class="layui-row">
        <h2>规则详情</h2>
        <table class="layui-table text-center">
            <thead>
            <tr>
                <th>匹配类型</th>
                <th>匹配条件</th>
                <th>值</th>
                <th>是否可走</th>
                <th>渠道列表</th>
                <th>下一条规则</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            {foreach $group->rules as $item}
            <tr>
                <td>{$item.rule_type}</td>
                <td>{$item.condition}</td>
                <td>{$item.rule_value}</td>
                <td>
                    <span class="{$item.is_include?'text-yellow':'text-muted'}"><i class="fa fa-circle"></i>{$item.is_include?'是':'否'}</span>
                </td>
                <td>{$item->channel->toArray()|array_column='channel_name'|join=', '}</td>
                <td>{$item.match_type}</td>
                <td>{$item.remark}</td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>
{/block}
{block name="script"}
{/block}